package com.zz.ecommerce.togatherDeclareMgr.common.bean;

import com.zz.bundles.cache.dict.DictTag;
import com.zz.ecommerce.common.constants.CommonConstants;
import com.zz.ecommerce.utils.BeanMapUtill;
import com.zz.ecommerce.utils.SqlType;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * <综合申报集装箱信息>
 * <功能详细描述>
 *
 * @author STEVEN
 * @date 2015/9/8,10:35
 */
public class TWorksheetContainer implements Serializable {
    private static final long serialVersionUID = 454898232418196682L;

    /**
     * 集装箱流水号
     */
    private String indx;

    /**
     * 委托流水号
     */
    private String conIndx;

    /**
     * 报检流水号
     */
    private String declNo;

    /**
     * 集装箱规格
     */
    private String containty;

    /**
     * 集装箱规格
     */
    private String containtyNameC;

    /**
     * 集装箱规格
     */
    private String containtyNameI;

    /**
     * 报关集装箱规格
     */
    private String containtyC;

    /**
     * 报检集装箱规格
     */
    private String containtyI;

    /**
     * 集装箱号
     */
    private String containno;

    /**
     * 集装箱自重（KG）
     */
    private BigDecimal containweight;

    /**
     * 集装箱数量(报检使用，新增)
     */
    private BigDecimal containerQty;

    /**
     * 集装箱申报类型：0报检，1报关，2综合
     */
    @SqlType(inSuffix = "#")
    private String decType;


    public BigDecimal getContainerQty() {
        return this.containerQty;
    }

    public void setContainerQty(BigDecimal containerQty) {
        this.containerQty = containerQty;
    }

    public String getDecType() {
        return this.decType;
    }

    public void setDecType(String decType) {
        this.decType = decType;
    }

    /**
     * @return 集装箱流水号
     */
    public String getIndx() {
        return indx;
    }

    /**
     * @param indx 集装箱流水号
     */
    public void setIndx(String indx) {
        this.indx = indx;
    }

    /**
     * @return 委托流水号
     */
    public String getConIndx() {
        return conIndx;
    }

    /**
     * @param conIndx 委托流水号
     */
    public void setConIndx(String conIndx) {
        this.conIndx = conIndx;
    }

    /**
     * @return 报检流水号
     */
    public String getDeclNo() {
        return declNo;
    }

    /**
     * @param declNo 报检流水号
     */
    public void setDeclNo(String declNo) {
        this.declNo = declNo;
    }

    /**
     * @return 集装箱规格
     */
    public String getContainty() {

        return containty;
    }

    /**
     * @param containty 集装箱规格
     */
    public void setContainty(String containty) {
        this.containty = containty;
    }

    /**
     * @return 集装箱规格名称
     */
    public String getContaintyDisplay() {
        return DictTag.dictItem(CommonConstants.CONTAINER_TYPE, containty);
    }

    /**
     * @return 集装箱号
     */
    public String getContainno() {
        return containno;
    }

    /**
     * @param containno 集装箱号
     */
    public void setContainno(String containno) {
        this.containno = containno;
    }

    /**
     * @return 集装箱自重（KG）
     */
    public BigDecimal getContainweight() {
        return containweight;
    }

    /**
     * @param containweight 集装箱自重（KG）
     */
    public void setContainweight(BigDecimal containweight) {
        this.containweight = containweight;
    }

    public String getContaintyC() {
        return this.containtyC;
    }

    public void setContaintyC(String containtyC) {
        this.containtyC = containtyC;
    }

    public String getContaintyI() {
        return this.containtyI;
    }

    public void setContaintyI(String containtyI) {
        this.containtyI = containtyI;
    }

    public String getContaintyNameC() {
        return this.containtyNameC;
    }

    public void setContaintyNameC(String containtyNameC) {
        this.containtyNameC = containtyNameC;
    }

    public String getContaintyNameI() {
        return this.containtyNameI;
    }

    public void setContaintyNameI(String containtyNameI) {
        this.containtyNameI = containtyNameI;
    }


    /**
     * 生成海关集装箱信息
     *
     * @return
     */
    public TContainers toTContainers() {
        TContainers containers = new TContainers();
        containers.setIndx(this.indx);
        containers.setConIndx(this.conIndx);
        containers.setContainty(this.containtyC);
        containers.setContainno(this.containno);
        containers.setContainweight(this.containweight);
        containers.setEnyIndx(null);
        return containers;
    }

    /**
     * 生成国检集装箱信息
     *
     * @return
     */
    public TDeclContainer toTDeclContainer() {
        TDeclContainer containers = new TDeclContainer();
        containers.setIndx(this.indx);
        containers.setConIndx(this.conIndx);
        containers.setContainerCode(this.containno);
        containers.setContainerModelCode(this.containtyI);
        containers.setContainerQty(this.containerQty);
        containers.setDeclNo(this.declNo);
        return containers;
    }

    /**
     * 生成国检集装箱信息Temp
     *
     * @return
     */
    public TempDeclContainer toTempDeclContainer() {
        TDeclContainer containers = toTDeclContainer();
        return BeanMapUtill.swap(containers, TempDeclContainer.class);
    }


    @Override
    public String toString() {
        return "TWorksheetContainer{" +
                "indx='" + indx + '\'' +
                ", conIndx='" + conIndx + '\'' +
                ", declNo='" + declNo + '\'' +
                ", containty='" + containty + '\'' +
                ", containtyNameC='" + containtyNameC + '\'' +
                ", containtyNameI='" + containtyNameI + '\'' +
                ", containtyC='" + containtyC + '\'' +
                ", containtyI='" + containtyI + '\'' +
                ", containno='" + containno + '\'' +
                ", containweight='" + containweight + '\'' +
                ", containerQty='" + containerQty + '\'' +
                ", decType='" + decType + '\'' +
                '}';
    }


}
